package com.gears_software.bbnetwork.adapters;

import java.util.List;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.gears_software.bbnetwork.datas.models.AchieveBankIconUrls;
import com.gears_software.bbnetwork.views.YinghangItemView;
import com.gears_software.bbnetwork.views.YinghangItemView_;

public class YinghangAdapter extends BaseAdapter {

	List<AchieveBankIconUrls> list;
	Context context;
	
	
	public YinghangAdapter(List<AchieveBankIconUrls> list, Context context) {
		super();
		this.list = list;
		this.context = context;
	}

	@Override
	public int getCount() {
		return list.size();
	}

	@Override
	public AchieveBankIconUrls getItem(int arg0) {
		return list.get(arg0);
	}

	@Override
	public long getItemId(int arg0) {
		return arg0;
	}

	@Override
	public View getView(int arg0, View arg1, ViewGroup arg2) {
		YinghangItemView view = null;
		if(arg1==null){
			view = YinghangItemView_.build(context);
		}else{
			view = (YinghangItemView) arg1;
		}
		view.bind(getItem(arg0));
		return view;
	}

}
